﻿using System;
using System.IO;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml.Serialization;
using System.Web.Mvc;
using Oxite.Models;

namespace ECube.Web.CMS.Models
{
    
    public class Page  : EntityBase
    {

        PageProfile profile;

        public Page() 
        {           
        }
      
        public Page(Guid id):base(id)
        {
        }

        public Page(Guid id, SiteSmall site, string templateName, string title, string description, string slug, DateTime? published) : this(id)
        {
            Site = site;
            TemplateName = templateName;
            Title = title;
            Description = description;
            Slug = slug;
            Published = published;
        }

        public SiteSmall Site { get; private set; }
        public string TemplateName { get; private set; }
        public string Title { get; private set; }
        public string Description { get; private set; }
        public string Slug { get; private set; }
        public DateTime? Published { get; private set; }

        //运行时属性
        public bool IsEdit { get; set; }
        public string SiteMapNodeKey { get; set; }

        public PageProfile Profile {
            get
            {
                if (profile == null)
                {
                    profile = new PageProfile();
                }
                return profile;
            }
            set
            {
                profile = value;
            }
        }            
    }
}
